package Store;

import DataView.OperationInfo;

public class Operation extends CDElement 
{
	private OperationInfo info;
	
	public void mkElement(OperationInfo aElIN) 
	{
		super.mkElement(aElIN);
		info=aElIN;
	}
	
	public OperationInfo getInfo()
	{
		return info;
	}
	
	public Object getDescription() 
	{
		String s = info.getName().concat("(");
		
		int max=0;
		if(info.getAllParam()!=null) max = info.parameterSize();
		for (int i = 0 ; i<max ; i++)
		{
			s=s.concat(info.getParameter(i).getDescription());
			if(i!=max-1) s=s.concat(", ");
		}
		if(info.getReturnType()!=null)
			s=s.concat(") : "+info.getReturnType().getName());
		else s=s.concat(")");
		
		return s;
	}
	public void setOfClass(Class c)
	{
		info.setOfClass(c);
	}
	public Operation clone()
	{
		Operation clone = new Operation();
		clone.mkElement(info.clone());
		return clone;
	}
}